package IO.stream;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class BufferByteStream {
    public static void main(String[] args) throws IOException {
        byte[] buf = new byte[4096];
        OutputStream out = new BufferedOutputStream(System.out, 10);
        InputStream in = new BufferedInputStream(System.in, 10);
        int len = in.read(buf);
        while (len != -1) {
            out.write(buf, 0, len);
            len = in.read(buf);
        }
        out.flush();
    }
}
